#include <stdio.h>
#include <string.h>
int main()
{
    char a[10] = "hello";
    char b[10] = "hello";
    char c[10] = "hello123";
    int num_1 = strncmp(a, b, 5);
    int num_2 = strncmp(c, b, 5);
    // strcmp比较两个字符串是否相等
    // 相等返回0
    // 不等返回非0
    printf("%d\n", num_1);
    printf("%d\n", num_2);
    if (num_1 == 0)
    {
        printf("相同\n");
    }
    else
    {
        printf("不相同\n");
    }
    if (num_2 == 0)
    {
        printf("相同\n");
    }
    else
    {
        printf("不相同\n");
    }
    return 0;
}

